﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmbeddedSharp.Core;

namespace Zove.Desktop.Function {
    public class DescientificNode : FuncNode {

        public DescientificNode()
            : base("descientific") {
        }

        public override object Evaluate() {
            int length = Parameters.Count;
            if (length < 1) {
                throw new ArgumentException("Please specify a number.");
            }
            object number = Parameters[length - 1].Evaluate();
            decimal ret;
            Decimal.TryParse(number.ToString(), System.Globalization.NumberStyles.Any, null, out ret);
            return ret;
        }
    }
}
